<?php

/**
 * Created by PhpStorm.
 * User: bob
 * Date: 21/9/25
 * Time: 上午10:37
 */

namespace App\Api\Web\Controllers;

use App\Api\Account\Models\SystemMessageUser;
use App\Api\Account\Models\UserAccount;
use App\Api\Account\Services\BusinessService;
use App\Api\Admin\Models\Banner;
use App\Api\Admin\Models\Community;
use App\Api\Admin\Models\Site;
use App\Api\Admin\Models\Subway;
use App\Api\Admin\Models\SubwaySite;
use App\Api\Auth\Models\UsersOpenId;
use App\Api\Web\Models\House;
use App\Api\Web\Models\HouseTag;
use App\Api\Web\Models\HouseWanted;
use App\Api\Web\Models\OrderHouse;
use App\Api\Web\Services\HouseService;
use App\Http\Controllers\Controller;
use App\Libs\Payment\RockyPayLibrary;
use App\User;
use Carbon\Carbon;
use Illuminate\Http\Request;

class AuthController extends Controller
{
    public function login(Request $request)
    {
        $params = $request->all();

        $name = data_get($params, 'name', '');
//        $password = data_get($params, 'password', '');
        if (\Auth::guard('business')->attempt(['name' => $name, 'password' => $params['password']], 1)) {
            $user = \Auth::user();
            return $this->formatOutput($user);
        } else {
            throw new \LogicException('用户名或密码错误', 20);
        }
    }


}
